import Koa from 'koa'
import router from './router/index.js';
import { sync } from './db/index.js';
import bodyParser from 'koa-bodyparser';
import koaCors from 'koa-cors';

const app = new Koa();

app.use(koaCors())

app.use(bodyParser())

sync();

app.use(router)

app.listen(3000, () => {
    console.log("服务运行地址如下: \nhttp://localhost:3000");
})